<template>
  <h2>setup的参数</h2>
  <button @click="fn">count++</button>
  <ChildIndex msg="hello" :count="count" @abc="abc" />
</template>

<script>
import ChildIndex from "../components/ChildIndex7.vue";
import { ref } from "vue";
export default {
  // components选项是不能放到setup的里面
  components: {
    ChildIndex,
  },
  setup() {
    const count = ref(1);
    const fn = () => {
      count.value++;
    };
    const abc = (n) => {
      console.log("abc", n);
    };

    return {
      count,
      fn,
      abc,
    };
  },
};
</script>
